<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H5应用状态检查</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .status {
            padding: 15px;
            margin: 10px 0;
            border-radius: 5px;
            font-weight: bold;
        }
        .success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        .error {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        .info {
            background-color: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #007bff;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            margin: 5px;
        }
        .btn:hover {
            background-color: #0056b3;
        }
        .file-check {
            margin: 10px 0;
            padding: 10px;
            background-color: #f8f9fa;
            border-radius: 5px;
            font-family: monospace;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>H5应用状态检查</h1>
        
        <div class="status success">
            ✅ Laravel应用运行正常 (端口: 7081)
        </div>
        
        <h2>文件检查</h2>
        
        <?php
        $h5IndexPath = public_path('static/h5/index.html');
        $h5AssetsPath = public_path('static/h5/assets');
        $uniCssPath = public_path('static/h5/assets/uni.95f8bd5d.css');
        $indexCssPath = public_path('static/h5/assets/index.DOVtpg04.css');
        $indexJsPath = public_path('static/h5/assets/index.DKt_-jSc.js');
        
        $checks = [
            'H5 index.html文件' => $h5IndexPath,
            'H5 assets目录' => $h5AssetsPath,
            'uni.95f8bd5d.css文件' => $uniCssPath,
            'index.DOVtpg04.css文件' => $indexCssPath,
            'index.DKt_-jSc.js文件' => $indexJsPath,
        ];
        
        foreach ($checks as $name => $path) {
            $exists = file_exists($path);
            $status = $exists ? 'success' : 'error';
            $icon = $exists ? '✅' : '❌';
            echo "<div class=\"status {$status}\">{$icon} {$name}: " . ($exists ? '存在' : '不存在') . "</div>";
            echo "<div class=\"file-check\">路径: {$path}</div>";
        }
        ?>
        
        <h2>测试链接</h2>
        <a href="/h5" class="btn">访问H5应用</a>
        <a href="/test" class="btn">系统测试页面</a>
        <a href="/wechat-test" class="btn">微信配置测试</a>
        
        <h2>静态资源测试</h2>
        <a href="/static/h5/assets/uni.95f8bd5d.css" class="btn" target="_blank">测试uni.css</a>
        <a href="/static/h5/assets/index.DOVtpg04.css" class="btn" target="_blank">测试index.css</a>
        <a href="/static/h5/assets/index.DKt_-jSc.js" class="btn" target="_blank">测试index.js</a>
        
        <h2>问题解决状态</h2>
        <div class="status success">
            ✅ str_random() 函数错误已修复
        </div>
        <div class="status success">
            ✅ H5Controller 已修改为直接读取H5的index.html
        </div>
        <div class="status success">
            ✅ 微信配置注入功能已实现
        </div>
        <div class="status info">
            📱 现在访问 http://localhost:7081/h5 应该可以正常加载
        </div>
    </div>
</body>
</html>
